<?php
/**
 * Created by PhpStorm.
 * User: Sky
 * Date: 16/1/27
 * Time: 下午2:26
 */
use yii\helpers\Html;
use yii\helpers\Url;
use app\lib\WeixinUtils;

$web = Url::to("@web");

?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <title>我的朵拉币</title>
    <link type="text/css" href="<?= $web ?>/css/home/doracoin-record.css" rel="stylesheet"/>
    <link type="text/css" href="<?= $web ?>/css/global.css" rel="stylesheet"/>
    <style type="text/css">
        .list_left_img_on {
            background-image: url(<?= $web ?>/img/home/doracoin-record/list_img1.png);
        }

        .list_left_img {
            background-image: url(<?= $web ?>/img/home/doracoin-record/list_img.png);
        }
    </style>
    <script type="text/javascript" src="<?= $web ?>/js/jquery.js"></script>
    <script>
        $(function () {
            // 任何需要执行的js特效
            var w = $(window).width();
            if (w > 640) {
                w = 640;
            }
            $("body").css("font-size", w * 20 / 320);

            var date = new Date();
            $("#current_year").text(date.getFullYear() + "年");
            $("#current_month").text(date.getMonth() + 1);
            $("#current_day").text(date.getDate());
        });

    </script>
</head>
<body>
<div class="main">
    <div class="top">
        <div class="top_left">
            <div class="top_left_year" id="current_year"></div>
            <div class="top_left_month">
                <label class="month" id="current_month"></label> 月
                &nbsp;&nbsp;<img src="<?= $web ?>/img/home/doracoin-record/top_left_right.png"
                                 style="width:0.3em; height:0.9em;"/>&nbsp;&nbsp;
                <label class="day" id="current_day"></label> 日
            </div>
        </div>
        
        <div class="top_right">
            <div class="top_right_head" style=" background-image: url(<?= $user_header_img ?>);"></div>
            <div class="top_right_text">
                <div class="top_right_text_top" style="text-align:center;">可用朵拉币</div>
                <div class="top_right_text_price" style="text-align:center;"><?= $total_doracoin ?></div>
            </div>
        </div>
    </div>
</div>
<div class="main1">
    <?php
    foreach ($doracoin_list as $doracoin) {
        $name='';
        if($doracoin["TYPE"]==1){
            $name ="礼卡";
        }
        if($doracoin["TYPE"]==2){
            $name ="礼包";
        }
        if($doracoin["TYPE"]==3){
            $name ="单品";
        }

        if($doracoin["DORACOIN"]<0){
            ?>
            <div style="width:16em; height:4em;">
                <div class="list">
                    <div class="list_left">
                        <div class="list_left_img"></div>
                        <div class="list_left_text"><?= date("m-d", strtotime($doracoin['CREATE_DATETIME'])) ?></div>
                    </div>
                    <div class="list_y" style="float:right; width:12em;">
                        <div class="list_center">购买<?= $name ?> </div>
                        <div class="list_right"> <?= $doracoin["DORACOIN"] ?></div>
                    </div>
                </div>
            </div>
            <?php
        }else {
            ?>
            <div style="width:16em; height:4em;">
                <div class="list">
                    <div class="list_left">
                        <div class="list_left_img"></div>
                        <div class="list_left_text"><?= date("m-d", strtotime($doracoin['CREATE_DATETIME'])) ?></div>
                    </div>
                    <div class="list_y" style="float:right; width:12em;">
                        <div class="list_center"><?= $name ?> 兑换成朵拉币</div>
                        <div class="list_right">+ <?= $doracoin["DORACOIN"] ?></div>
                    </div>
                </div>
            </div>
            <?php
        }
    }
    ?>
    <div style="width:100%; height:3.5em; background-color:#FFF5FF; display:none;">
        <div class="list_on">
            <div class="list_left_on">
                <div class="list_left_img_on"></div>
                <div class="list_left_text_on">01-24</div>
            </div>
            <div class="list_y_on">
                <div class="list_center_on">领取了 和卉堂黑檀木招财金龙鱼摆</div>
                <div class="list_right_on">+ 500</div>
            </div>
        </div>
    </div>
</div>

</body>
</html>